from django.contrib.syndication.views import Feed
from models import Capitulo

class LatestEntriesFeed(Feed):
    title = "Series.TopoRojo.es"
    link = "/series/"
    description = "RSS de los capitulos"

    def items(self):
        return Capitulo.objects.order_by('-usa_date')[:5]

    def item_title(self, item):
        return item.name

    def item_description(self, item):
        return item.serie
